﻿Imports System.ComponentModel

Namespace Converters
    Public Class SelectedToVisiability
        Implements IValueConverter

        Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.Convert
            If value IsNot Nothing Then
                Return Visibility.Visible
            Else
                Try
                    If IsInDesignMode() Then
                        Return Visibility.Visible
                    Else
                        Return Visibility.Hidden
                    End If
                Catch ex As Exception
                    Return Visibility.Hidden
                End Try


            End If
        End Function

        Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
            Return Nothing
        End Function
    End Class
End Namespace